package com.cll.pmis.entity;

import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.enums.IdType;
import com.cll.pmis.common.validator.group.Insert;
import io.github.llchen.apidoc.annotation.ApiModel;
import io.github.llchen.apidoc.annotation.ApiModelProperty;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.NotBlank;

import java.beans.Transient;
import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 
 * </p>
 *
 * @author chenliangliang
 * @since 2018-06-18
 */

@EqualsAndHashCode(callSuper = false)
@ApiModel(description = "用户表")
public class User implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 用户id
     */
    @ApiModelProperty(name = "id",description = "用户id")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    /**
     * 用户名
     */
    @NotBlank(message = "用户名不能为空",groups = {Insert.class})
    @ApiModelProperty(name = "username",description = "用户名")
    private String username;
    /**
     * 密码
     */
    @NotBlank(message = "密码不能为空",groups = {Insert.class})
    private String password;
    /**
     * 电话号码
     */
    @ApiModelProperty(name = "phone",description = "手机号码")
    private String phone;
    /**
     * 年龄
     */
    @ApiModelProperty(name = "age",description = "年龄")
    private Integer age;
    /**
     * 性别
     */
    @ApiModelProperty(name = "sex",description = "性别")
    private Integer sex;
    /**
     * 地址
     */
    @ApiModelProperty(name = "address",description = "住址")
    private String address;
    /**
     * 角色
     */
    private Integer role;
    /**
     * 状态
     */
    private Integer status;
    /**
     * 邮箱
     */
    private String email;
    /**
     * 创建时间
     */
    private Date createTime;
    /**
     * 更新时间
     */
    private Date updateTime;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    @Transient
    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Integer getSex() {
        return sex;
    }

    public void setSex(Integer sex) {
        this.sex = sex;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public Integer getRole() {
        return role;
    }

    public void setRole(Integer role) {
        this.role = role;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", phone='" + phone + '\'' +
                ", age=" + age +
                ", sex=" + sex +
                ", address='" + address + '\'' +
                ", role=" + role +
                ", status=" + status +
                ", email='" + email + '\'' +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                '}';
    }
}
